var MyQueue = function () {
    this.stack1 = []
    this.stack2 = []
};

/** 
 * @param {number} x
 * @return {void}
 */
MyQueue.prototype.push = function (x) {
    this.stack1.push(x)
};

/**
 * @return {number}
 */
MyQueue.prototype.pop = function () {
    if (this.stack1.length) {
        while (this.stack1.length > 1) {
            this.stack2.push(this.stack1.pop())
        }
        let ans = this.stack1.pop()
        while (this.stack2.length) {
            this.stack1.push(this.stack2.pop())
        }
        return ans
    }
    return null
};

/**
 * @return {number}
 */
MyQueue.prototype.peek = function () {
    return this.stack1.slice(0, 1)[0]
};

/**
 * @return {boolean}
 */
MyQueue.prototype.empty = function () {
    if (this.stack1.length) {
        return false
    }
    return true
};
